<div class="bjui-pageContent">
    <p class="text-warning">视频不能超过20M，超过20M的视频可至腾讯视频上传后添加，视频时长不少于1秒，不多于10小时</p>
    <form action="{:U('save_wx_video')}" data-callback="dialogFormCall" data-toggle="validate" data-alertmsg="false" class="dialogForm">
        <input type="hidden" name="id" value="{$va.id}"/>
        <div class="form-group">
            <label class="x100">名称:</label>
            <input type="text" name="name" data-rule="required" class="w300" value="{$va.name}" />
        </div>
        <div class="form-group clearfix">
            <label class="x100 pull-left">上传:</label>
            <div class="pull-left parent_img">
                <span class="parent_img_span" <if condition="$va.file eq null">style="display:none"</if>>文件名:{$va.file}</span>
                <input type="hidden" name="file" value="{$va.file}"/>
                <span data-toggle="upload" 
                data-uploader="{:U('Index/upload',array('type'=>5))}"
                 data-file-type-exts="*.mp4;*.wmv;*.avi;*.rmvb;*.3gp"
                 data-icon="cloud-upload"
                 data-on-upload-success="video_upload"
                 data-auto="true"
                 data-button-text="上传视频"
                ></span>
            </div>
        </div>
        <div class="form-group">
            <label class="x100">备注:</label>
            <textarea name="mark" class="w400">{$va.mark}</textarea>
        </div>
    </form>
</div>
<script>
  function video_upload(e, data, ele) {
	  data = JSON.parse(data);
	  if(data[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
          $('.parent_img').find("input[type='hidden']").val(data.message);
          $(".parent_img_span").show().text("文件名:"+data.message);
      }else{
          ele.bjuiajax('ajaxDone', data);
      }
  }
</script>
<include file="Common/footer" ftype="save" />